home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / FLTK-1.0.6 / src / Fl_Window_fullscreen.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-07  |  2.3 KB  |  76 lines

  1. //
  2. // "$Id: Fl_Window_fullscreen.cxx,v 1.5 1999/01/07 19:17:29 mike Exp $"
  3. //
  4. // Fullscreen window support for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-1999 by Bill Spitzak and others.
  7. //
  8. // This library is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems to "fltk-bugs@easysw.com".
  24. //
  25.  
  26. // Turning the border on/off by changing the motif_wm_hints property
  27. // works on Irix 4DWM.  Does not appear to work for any other window
  28. // manager.  Fullscreen still works on some window managers (fvwm is one)
  29. // because they allow the border to be placed off-screen.
  30.  
  31. // Unfortunatly most X window managers ignore changes to the border
  32. // and refuse to position the border off-screen, so attempting to make
  33. // the window full screen will lose the size of the border off the
  34. // bottom and right.
  35.  
  36. #include <FL/Fl.H>
  37. #include <FL/x.H>
  38.  
  39. void Fl_Window::border(int b) {
  40.   if (b) {
  41.     if (border()) return;
  42.     clear_flag(FL_NOBORDER);
  43.   } else {
  44.     if (!border()) return;
  45.     set_flag(FL_NOBORDER);
  46.   }
  47. #ifdef WIN32
  48.   // not yet implemented, but it's possible
  49.   // for full fullscreen we have to make the window topmost as well
  50. #else
  51.   if (shown()) Fl_X::i(this)->sendxjunk();
  52. #endif
  53. }
  54.  
  55. void Fl_Window::fullscreen() {
  56. #ifndef WIN32
  57.   //this would clobber the fake wm, since it relies on the border flags to
  58.   //determine its thickness
  59.   border(0);
  60. #endif
  61.   if (!x()) x(1); // force it to call XResizeWindow()
  62.   resize(0,0,Fl::w(),Fl::h());
  63. }
  64.  
  65. void Fl_Window::fullscreen_off(int X,int Y,int W,int H) {
  66.   // this order produces less blinking on IRIX:
  67.   resize(X,Y,W,H);
  68. #ifndef WIN32
  69.   border(1);
  70. #endif
  71. }
  72.  
  73. //
  74. // End of "$Id: Fl_Window_fullscreen.cxx,v 1.5 1999/01/07 19:17:29 mike Exp $".
  75. //
  76.